package com.ruoyi.business.service;

import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.business.domain.Task;
import com.ruoyi.business.domain.TaskSurvey;
import com.ruoyi.business.request.*;
import com.ruoyi.business.response.*;
import com.ruoyi.common.core.domain.PageResult;

import java.util.List;
import java.util.Map;

/**
 * 任务Service接口
 *
 * @author Eric
 * @date 2024-03-17
 */
public interface ITaskService extends IService<Task> {

    Boolean createTask(TaskCreateReq req);

    /**
     * 获取任务详情
     * @param id 任务id
     * @return
     */
    TaskRes getTaskById(Long id);

    /**
     * 提交任务
     * @param taskId 任务id
     * @return
     */
    Boolean submitAuditTask(Long taskId);

    /**
     * 审核任务
     * @param req 入参
     * @return
     */
    Boolean auditTask(TaskAuditReq req);

    /**
     * 完成任务
     * @param taskId 任务id
     * @return
     */
    Boolean end(Long taskId);

    /**
     * App获取任务分页列表
     * @param req 查询参数
     * @return
     */
    PageResult<ApiTaskRes> pageTaskList(ApiTaskReq req);

    List<ApiTaskPointRes> getTaskPointApi(Long taskId);

    Boolean updateTask(TaskUpdateReq req);

    ApiTaskPointInfoRes getTaskPointInfo(Long taskId, Long pointId);

    /**
     * 提交任务调研
     * @param req
     * @return
     */
    Boolean submitSurveyTask(ApiTaskSubmitReq req);

    List<ApiTaskPointRes> getTaskPointByPlanId(Long id);

    List<Map<String, Object>> getPointByTask(Long taskId);

    List<TaskSurveyRes> getSurveyByPointId(Long pointId, Long userId);

    List<TaskExportRes> getExportList(TaskExportReq req, String exportPath);

    List<ApiTaskPointRes> getTaskUserPointApi(Long researchPlanId, Long userId);

    List<JSONObject> selectTaskUser(Long planId, String name);

    void syncData(Long[] ids);
}
